#pragma once
#include "SCoreStd.h"
#include "SFrustum.h"
#include "SInput.h"
#include "STime.h"

class SCamera
{
public :
	SFrustum*			m_pFrustum;
	SInput				m_Input;
	STime				m_Time;
	HWND				m_hWnd;

public : 
	LPDIRECT3DDEVICE9	m_pd3dDevice;
	D3DXMATRIX			matView;
	D3DXMATRIX			matProj;
	D3DXMATRIX			matWorld;
	
	bool				m_bFrustumRender;

private :
	D3DXVECTOR3			vPosion;
	D3DXVECTOR3			vLookVector;
	D3DXVECTOR3			vUpVecTor;
	D3DXVECTOR3			vRightVector;
	D3DXQUATERNION		qRotate;
	POINT				deltatpos;

private :
	bool				IsMove;
	

private :
	float				xAngle;
	float				yAngle;

public :
	bool	InIt();
	bool	Frame();
	bool	Release();
	bool	Input();
	bool	Render();
	

public :
	bool	MakeFrustum( D3DXMATRIX matView, D3DXMATRIX matProj );
	SFrustum*			GetFrustum();
	bool				m_bMakeFrustum;
	POINT				m_MouseFirePos;
	POINT				m_MouseNextPos;
	void	SetHwnd( HWND _hWnd ) { m_hWnd = _hWnd; }
public :
	void	SetDevice( LPDIRECT3DDEVICE9	pd3dDevice );
	bool	CreateWorldMatrix();
	bool	CreateViewMatrix( D3DXVECTOR3 vPos, D3DXVECTOR3 vTarget );
	bool	CreateProjecTionMatrix();
	bool	SetVIewMatrix();
	void	DrawFrustum();
//	void	SetInput( SInput* _mInput ) { m_Input = _mInput; }

public :
	void	UpMove( float delta );
	void	DownMove( float delta );
	void	RightMove( float delta );
	void	LeftMove( float delta );
	void	ZoomUpMove( float delta );
	void	ZoomDownMove( float delta );
	void	Rotate( float deltaX, float deltaY );

public :
	void	SetMakeFrustum( bool bMake ) { m_bMakeFrustum = bMake; }


public :
	SCamera(void);
	~SCamera(void);

};
































	


